# 指定运行路径/home/data/ws
build_index=$1

# 获取PR代码(这个不确定，需要对齐）
git config --global user.name 'wangsong96'
git config --global user.email 'wangsong109@huawei.com'
cd /home/data/ws/cann-ops-adv-dev
git fetch https://gitee.com/ascend/cann-ops-adv-dev.git pull/${build_index}/head:pr_${build_index}
git checkout pr_${build_index}

# 构建cann包
conda activate ws
cd /home/data/ws/Mycann
bash set_canndev.sh

# 编译
cd /home/data/ws/cann-ops-adv-dev
source /home/data/ws/Mycann/run_package/ascend-toolkit/set_env.sh
bash build.sh -b host --disable-check-compatible

cd /home/data/ws/cann-ops-adv-dev/output
./CANN-custom_ops--linux.aarch64.run --quiet

# 执行
cd /home/data/ws/cann-ops-adv-dev-atk/tests/DT/FusedIncreAttentionScoreV2
source /home/data/ws/Mycann/run_package/ascend-toolkit/set_env.sh
atk task -c aclnn_fused_infer_attention_v2.json -n node.yaml -p executor_aclnn_fiav2.py